package com.reactor.demo.flux;

import lombok.extern.slf4j.Slf4j;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;

/**
 * @author jing
 * @description
 * @date 2018/12/10 0010 23:14
 */
@Slf4j
public abstract class Flux<T> implements Publisher<T> {
    /**
     * flux作为一个发布者通过subsribe发布消息
     * @param s
     */
    public abstract void subscribe(Subscriber<? super T> s);

    public static <T> Flux<T> just(T... data) {
        log.info("[Flux.just] the just start!!!!!");
        return new FluxArray<>(data);
    }

}
